/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.boxin.ims.modules.wechat.score.dao;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.thinkgem.jeesite.common.persistence.BaseDao;
import com.thinkgem.jeesite.common.persistence.BaseDaoImpl;
import com.boxin.ims.modules.wechat.score.entity.ExchangeRecord;

/**
 * 积分对换记录DAO接口
 * @author Jakemanse
 * @version 2013-09-23
 */
public interface ExchangeRecordDao extends ExchangeRecordDaoCustom, CrudRepository<ExchangeRecord, Long> {

	@Modifying
	@Query("update ExchangeRecord set delFlag='" + ExchangeRecord.DEL_FLAG_DELETE + "' where id = ?1")
	public int deleteById(Long id);
	
	@Modifying
	@Query("update ExchangeRecord set delFlag='" + ExchangeRecord.DEL_FLAG_NORMAL + "',status = ?2 ,update_time = now()  where id = ?1")
	public int updateStatusById(Long id,String status);
	
}

/**
 * DAO自定义接口
 * @author Jakemanse
 */
interface ExchangeRecordDaoCustom extends BaseDao<ExchangeRecord> {

}

/**
 * DAO自定义接口实现
 * @author Jakemanse
 */
@Component
class ExchangeRecordDaoImpl extends BaseDaoImpl<ExchangeRecord> implements ExchangeRecordDaoCustom {

}
